home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
smallc.arc
/
WRITE.C
< prev
next >
Wrap
Text File
|
1985-07-17
|
1KB
|
42 lines
/***********************************************************
* IBM PC "C" Bulletin Board *
* Tulsa, OK 918-664-8737 *
* SYSOP Lynn Long 300/1200 XMODEM *
***********************************************************/
#include "io.h"
#include "errno.h"
int filewr(), badfd(), conwr();
static int (*wrt_tab[])() = {
badfd, filewr, conwr,
};
write(fd, buff, len)
char *buff;
{
register struct channel *chp;
if (fd < 0 || fd > MAXCHAN) {
errno = EBADF;
return -1;
}
chp = &chantab[fd];
return (*wrt_tab[chp->c_write])(chp->c_arg, buff, len);
}
conwr(kind, buff, len)
register char *buff;
{
register int count;
for (count = 0 ; count < len ; ++count)
bdos(kind, *buff++);
return count;
}